package city.spring.shift;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.ArrayList;
import java.util.List;

/**
 * 排班管理
 *
 * @author HouKunLin
 * @date 2020/5/28 0028 22:49
 */
public class ShiftMain {
    private static final Logger logger = LoggerFactory.getLogger(ShiftMain.class);

    public static void main(String[] args) {
        test1();
        test2();
        test3();
        // System.out.println(1L << 62);
        // System.out.println(450326199609011215L);
        // System.out.println(0b0111111111_1111111111_1111111111_1111111111_1111111111_1111111111_1111L);
    }

    public static void test1() {
        List<Period> periods = new ArrayList<>();
        periods.add(new Period("早班", "8:00-16:00", 2));
        periods.add(new Period("中班", "16:00-24:00", 2));
        periods.add(new Period("晚班", "00:00-08:00", 2));

        List<People> peoples = new ArrayList<>();
        for (int i = 0; i < 15; i++) {
            peoples.add(new People("人员-" + i, 0));
        }
        Plan plan = new Plan("五天班", 5, periods, peoples);
        plan.calc();
    }

    public static void test3() {
        List<Period> periods = new ArrayList<>();
        periods.add(new Period("早班", "8:00-16:00", 2));
        periods.add(new Period("中班", "16:00-24:00", 2));
        periods.add(new Period("晚班", "00:00-08:00", 2));

        List<People> peoples = new ArrayList<>();
        for (int i = 0; i < 15; i++) {
            peoples.add(new People("人员-" + i, 0));
        }
        Plan plan = new Plan("一个月", 30, periods, peoples);
        plan.calc();
    }

    public static void test2() {
        List<Period> periods = new ArrayList<>();
        periods.add(new Period("第一节课", "8:00-16:00", 1));
        periods.add(new Period("第二节课", "16:00-24:00", 1));
        periods.add(new Period("第三节课", "00:00-08:00", 1));
        periods.add(new Period("第四节课", "00:00-08:00", 1));
        periods.add(new Period("第五节课", "00:00-08:00", 1));
        periods.add(new Period("第六节课", "00:00-08:00", 1));
        periods.add(new Period("第七节课", "00:00-08:00", 1));
        // periods.add(new Period("第八节课", "00:00-08:00", 1));
        // periods.add(new Period("第九节课", "00:00-08:00", 1));

        List<People> peoples = new ArrayList<>();
        peoples.add(new People("语文", 0));
        peoples.add(new People("数学", 0));
        peoples.add(new People("英语", 0));
        peoples.add(new People("物理", 0));
        peoples.add(new People("化学", 0));
        peoples.add(new People("生物", 0));
        peoples.add(new People("体育", 0));
        peoples.add(new People("音乐", 0));
        // peoples.add(new People("自习", 0));

        Plan plan = new Plan("课程表", 5, periods, peoples);
        plan.calc();
    }
}
